/*
   LineDisplayControl.cpp
   
   Copyright (C) 2006 LinuxOne, Inc. <Republic of korea>

   This library is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   Lessor General Public License for more details.

   You should have received a copy of the GNU Lessor General Public
   License along with this library; if not, write to the Free Software
   Foundation, inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

   Hyunjin Kim <mgc521@linuxone.co.kr>

   LinuxOne, Inc., hereby disclaims all copylight
   written by Hyunjin Kim, 20 December 2006
*/

#include <control/LineDisplayControl.h>

namespace booyopos
{

CLineDisplay::CLineDisplay()
{
	deviceControlDescription = "BooyoPOS LineDisplay Device Control";
	deviceControlVersion = 0;

	lds= new services::CLineDisplayService;

	CBaseControl::bs=dynamic_cast<services::CBaseService *>(lds);
}

CLineDisplay::~CLineDisplay()
{
}

/* Capabilities */
int 
CLineDisplay::GetCapBlink() 
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapBlink();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}


bool 
CLineDisplay::GetCapBrightness() 
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapBrightness();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int 
CLineDisplay::GetCapCharacterSet()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapCharacterSet();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapDescriptors()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapDescriptors();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapHMarquee()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapHMarquee();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapICharWait()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapICharWait();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapVMarquee()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapVMarquee();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCapPowerReporting()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapPowerReporting();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapBlinkRate()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapBlinkRate();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCapCursorType()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapCursorType();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapCustomGlyph()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapCustomGlyph();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCapReadBack()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapReadBack();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCapReverse()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapReverse();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapBitmap()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapBitmap();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapMapCharacterSet()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapMapCharacterSet();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapScreenMode()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapScreenMode();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapStatisticsReporting()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapStatisticsReporting();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapUpdateStatistics()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapUpdateStatistics();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapCompareFirmwareVersion()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapCompareFirmwareVersion();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCapUpdateFirmware()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCapUpdateFirmware();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

/* Properties */
int
CLineDisplay::GetCharacterSet()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCharacterSet();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetCharacterSet(int characterSet)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetCharacterSet(characterSet);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

std::string
CLineDisplay::GetCharacterSetList()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCharacterSetList();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetColums()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetColums();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCurrentWindow()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCurrentWindow();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetCurrentWindow(int currentWindow)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetCurrentWindow(currentWindow);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCursorColumn()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCursorColumn();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetCursorColumn(int cursorColumn)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetCursorColumn(cursorColumn);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCursorRow()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCursorRow();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetCursorRow(int cursorRow)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetCursorRow(cursorRow);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetCursorUpdate()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCursorUpdate();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetCursorUpdate(bool cursorUpdate)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetCursorUpdate(cursorUpdate);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetDeviceBrightness()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetDeviceBrightness();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetDeviceBrightness(int deviceBrightness)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetDeviceBrightness(deviceBrightness);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetDeviceColumns()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetDeviceColumns();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetDeviceDescriptors()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetDeviceDescriptors();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetDeviceRows()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetDeviceRows();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetDeviceWindows()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetDeviceWindows();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetInterCharacterWait()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetInterCharacterWait();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetInterCharacterWait(int interCharacterWait)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetInterCharacterWait(interCharacterWait);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetMarqueeFormat()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetMarqueeFormat();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetMarqueeFormat(int marqueeFormat)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetMarqueeFormat(marqueeFormat);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetMarqueeRepeatWait()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetMarqueeRepeatWait();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetMarqueeRepeatWait(int marqueeRepeatWait)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetMarqueeRepeatWait(marqueeRepeatWait);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetMarqueeType()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetMarqueeType();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetMarqueeType(int marqueeType)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetMarqueeType(marqueeType);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetMarqueeUnitWait()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetMarqueeUnitWait();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetMarqueeUnitWait(int marqueeUnitWait)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetMarqueeUnitWait(marqueeUnitWait);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetRows()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetRows();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetPowerNotify()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetPowerNotify();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetPowerNotify(int powerNotify)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetPowerNotify(powerNotify);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetPowerState()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetPowerState();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetBlinkRate()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetBlinkRate();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetBlinkRate(int blinkRate)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetBlinkRate(blinkRate);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetCursorType()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCursorType();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetCursorType(int cursorType)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetCursorType(cursorType);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

std::string
CLineDisplay::GetCustomGlyphList()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetCustomGlyphList();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetGlyphHeight()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetGlyphHeight();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetGlyphWidth()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetGlyphWidth();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

bool
CLineDisplay::GetMapCharacterSet()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetMapCharacterSet();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetMapCharacterSet(bool mapCharacterSet)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetMapCharacterSet(mapCharacterSet);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetMaximumX()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetMaximumX();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetMaximumY()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetMaximumY();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

int
CLineDisplay::GetScreenMode()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetScreenMode();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetScreenMode(int screenMode)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetScreenMode(screenMode);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

std::string
CLineDisplay::GetScreenModeList()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		return lds->GetScreenModeList();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

/* Added Methods */
void
CLineDisplay::Initialize()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->Initialize();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

/* Methods */
void
CLineDisplay::ClearDescriptors()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->ClearDescriptors();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::ClearText()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->ClearText();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::CreateWindow(int viewPortRow, int viewPortColumn, int viewPortHeight, int viewPortWidth, int windowHeight, int windowWidth)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->CreateWindow(viewPortRow, viewPortColumn, viewPortHeight, viewPortWidth, windowHeight, windowWidth);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::DestroyWindow()
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->DestroyWindow();
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::DisplayText(std::string data, int attribute)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->DisplayText(data, attribute);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::DisplayTextAt(int row, int column, std::string data, int attribute)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->DisplayTextAt(row, column, data, attribute);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::RefreshWindow(int window)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->RefreshWindow(window);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::ScrollText(int direction, int units)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->ScrollText(direction, units);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetDescriptor(int descriptor, int attribute)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetDescriptor(descriptor, attribute);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::DefineGlyph(int glyphcode, char* glyph)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->DefineGlyph(glyphcode, glyph);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::ReadCharacterAtCursor(int cursorData)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->ReadCharacterAtCursor(cursorData);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::DisplayBitmap(std::string fileName, int width, int alignmentX, int alignmentY)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->DisplayBitmap(fileName, width, alignmentX, alignmentY);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::SetBitmap(int bitmapNumber, std::string fileName, int width, int alignmentX, int alignmentY)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->SetBitmap(bitmapNumber, fileName, width, alignmentX, alignmentY);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

/* Statistics */
void
CLineDisplay::ResetStatistics(std::string statisticsBuffer)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->ResetStatistics(statisticsBuffer);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::RestieveStatistics(std::string statisticsBuffer[])
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->RestieveStatistics(statisticsBuffer);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::UpdateStatistics(std::string statisticsBuffer)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->UpdateStatistics(statisticsBuffer);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::CompareFirmwareVersion(std::string firmwareFileName, int* result)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->CompareFirmwareVersion(firmwareFileName, result);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

void
CLineDisplay::UpdateFirmware(std::string firmwareFileName)
throw (CByException)
{
	try
	{
		if(!bOpen)
		{
			throw CByException(E_CLOSED, "Control not opened");
		}
	
		lds->UpdateFirmware(firmwareFileName);
	}
	catch(CByException bye)
	{
		throw bye;
	}
	catch(std::exception e)
	{
		throw CByException(E_CLOSED, "Unhandled exception from Device Service", e);
	}
}

} // namespace booyopos
